

var readline = require('readline');

var r1 = readline.createInterface({
	input: process.stdin,
	output: process.stdout,
});

r1.on('line', function(line) {
	if (line == 'exit' || line == 'quit' || line == 'q')
		r1.close();
	else
		console.log('您输入了：' + line);
});


r1.on('SIGINT', function(){
	r1.question("Are you sure to quit? ", function(answer) {
		if(answer.match(/^y(es)?$/i))  r1.pause();
	});
});


r1.on('close', function() {
	console.log('行数据读取操作被终止');
	process.exit();
});